package com.problemproject.dome.gridView;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.GridView;

import com.problemproject.dome.R;

import java.util.ArrayList;
import java.util.List;
/**
 * GridViewActivity
 * gridView item 高度不一致
 * @author huo
 * @date 2022/4/2 下午 03:14
 */
public class GridViewActivity extends AppCompatActivity {
    private AutoGridView AutoGridView;
    private List<String> list = new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_grid_view);
        AutoGridView = (AutoGridView) findViewById(R.id.AutoGridView);
        AutoGridView.setNumColumns(6);
        list.add("000001");
        list.add("0000012");
        list.add("00000123");
        list.add("000001234");
        list.add("0000012345");
        list.add("00000123456");
        list.add("000001234567");
        list.add("0000012345678");
        list.add("00000123456789");

        GridViewAdapter gridViewAdapter = new GridViewAdapter(GridViewActivity.this, list);
        AutoGridView.setAdapter(gridViewAdapter);
    }
}